package com.lwc.cfdns.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lwc.cfdns.pojo.bo.system.ConfigBO;
import com.lwc.cfdns.pojo.dto.system.ConfigDTO;
import com.lwc.cfdns.pojo.dto.system.ConfigSetValueDTO;
import com.lwc.cfdns.pojo.entity.SystemConfig;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lwc.cfdns.pojo.vo.system.ConfigVO;

import java.util.Map;

/**
 * @author spring
 * @description 针对表【cfdns_system_config(系统配置表)】的数据库操作Service
 * @createDate 2023-06-01 09:22:52
 */
public interface SystemConfigService extends IService<SystemConfig> {

    /**
     * 创建
     *
     * @param configDTO
     * @return Map<String, Object>
     * @throws
     * @version 1.0.0
     * @author luwc
     * @time 2023/6/1 09:55:20
     */
    Map<String, Object> create(ConfigDTO configDTO);

    /**
     * 修改
     *
     * @param configDTO
     * @return Map<String, Object>
     * @throws
     * @version 1.0.0
     * @author luwc
     * @time 2023/6/1 09:55:34
     */
    Map<String, Object> update(ConfigDTO configDTO);

    /**
     * 详情
     *
     * @param id
     * @return ConfigVO
     * @throws
     * @version 1.0.0
     * @author luwc
     * @time 2023/6/1 09:55:54
     */
    ConfigVO view(Long id);

    /**
     * 删除
     *
     * @param ids
     * @return Map<String, Object>
     * @throws
     * @version 1.0.0
     * @author luwc
     * @time 2023/6/1 09:56:11
     */
    Map<String, Object> delete(String ids);

    /**
     * 列表
     *
     * @param configBO
     * @return IPage<SystemConfig>
     * @throws
     * @version 1.0.0
     * @author luwc
     * @time 2023/6/1 09:57:09
     */
    IPage<SystemConfig> lists(ConfigBO configBO);

    /**
     * 清除缓存
     *
     * @param enName
     * @return Map<String, Object>
     * @throws
     * @version 1.0.0
     * @author luwc
     * @time 2023/6/1 13:56:45
     */
    Map<String, Object> refreshCache(String enName);

    /**
     * 清除缓存
     *
     * @param
     * @return Map<String, Object>
     * @throws
     * @version 1.0.0
     * @author luwc
     * @time 2023/6/1 11:54:48
     */
    Map<String, Object> refreshCache();

    /**
     * 配置键名
     *
     * @param enName
     * @return ConfigVO
     * @throws
     * @version 1.0.0
     * @author luwc
     * @time 2023/6/1 13:43:27
     */
    ConfigVO viewByEnNameOfCache(String enName);

    /**
     * 配置键名
     *
     * @param enName 键名
     * @param force  强制刷缓存
     * @return ConfigVO
     * @throws
     * @version 1.0.0
     * @author luwc
     * @time 2023/6/1 13:44:32
     */
    ConfigVO viewByEnNameOfCache(String enName, Boolean force);

    /**
     * 更新值
     *
     * @param configSetValueDTO
     * @return Map<String, Object>
     * @throws
     * @version 1.0.0
     * @author luwc
     * @time 2023/6/1 17:34:29
     */
    Map<String, Object> setValue(ConfigSetValueDTO configSetValueDTO);
}
